<?php
/**
 * Template Name: Home Page
 * Description: 
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */

// Enqueue showcase script for the slider
wp_enqueue_script( 'twentyeleven-showcase', get_template_directory_uri() . '/js/showcase.js', array( 'jquery' ), '2011-04-28' );
get_header(); ?>

<html>
<div class="activityfeed">
	<div id="pagetitle">Activity Feed</div>
	<?php $comments = get_comments(); ?>
	<?php foreach($comments as $comment) : ?>		
		<div class="commentbox">
			<div id="commentcontent">
				<?php echo $comment->comment_content; ?>
			</div>
			<div id="commentmeta">
				<a href="http://students.washington.edu/andreybr/wordpress/?page_id=208&user=<?php echo $comment->user_id ?>"> 
					<?php echo $comment->comment_author ?> 
				</a> |
				<?php echo $comment->comment_date ?> |
				<a href="http://students.washington.edu/andreybr/wordpress/?p=<?php echo $comment->comment_post_ID ?>">
					<?php echo get_post($comment->comment_post_ID)->post_title; ?>
				</a> 			
			</div><!-- #meta -->
		</div><!-- .activitybox -->
	<?php endforeach; ?>
</div><!-- .activityfeed -->

<div class="projects">
	<div id="pagetitle">Top Projects</div>
	<?php query_posts('posts_per_page=5'); ?>
	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
		<div class="projectbox">
			<img id="image" src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcR50aIm-aqmY8doyUCZMwnzwbYiIG0eMeoIzRttRspGjlbiXbpv">
			<div id="name">
				<a href="http://students.washington.edu/andreybr/wordpress/?p=<?php echo get_the_ID() ?>">
					<?php the_title() ?>
				</a>
			</div>	
			<div id="meta">
				<a> <?php the_author_posts_link() ?> </a> | 
				<?php the_time('m/d/y') ?> | 
				Rating
			</div>		
			<div id="description">
				<?php the_content() ?>
			</div>
		</div><!-- projectbox -->	
	<?php endwhile; else: ?>
	<?php endif; ?>
</div><!-- projects -->
</html>

<?php get_footer(); ?>